<?php
require_once 'classes/photos.php';
require_once 'classes/albums.php';
require_once 'classes/mySession.php';

if(!$pgSession->isUserLoggedIn()){
	$retorno = array("status"=>FALSE,"message"=>"No user logged in.");
}else{
	$ownerN = $pgSession->getUserId();
	$resGeoAlb = $albumUtils->getUserGeoAlbums($ownerN);
	$resultPhotos = $photoUtils->findUserGeoPhotos($ownerN,null, -1);
	
	if($resGeoAlb["status"] && $resultPhotos["status"]){
		echo json_encode(array("status"=>TRUE, "geoalbums"=>$resGeoAlb["geoalbums"],"photos"=>$resultPhotos["photos"]));
	}
}

#CHECK SESSION TO USER ALREADY LOGGED IN

#IF NOT, REDIRECT TO LOGIN PAGE

#IF YES:
#	CHECK IF LAT AND LONG ARE VALID
#	IF YES:
#		CONNECT TO DATABASE
#		CHECK IF PHOTO ID IS VALID
#		TRY TO SAVE ON EXIF
#		TRY TO SAVE IN DATABASE
#		IF SAVED IN DATABASE, RETURN JSON WITH MESSAGE AND LOCATION
#	IF NOT, RETURN JSON WITH MESSAGE

?>